import java.util.Scanner;

/**
 * 输入一个整数，将这个整数以字符串的形式逆序输出
 * 程序不考虑负数的情况，若数字含有0，则逆序形式也含有0，如输入为100，则输出为001
 * Created by JiaJia on 2019/6/19 0019.
 */
public class HuaWei011 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            String str = scanner.nextLine();
            StringBuilder sb=new StringBuilder(str);
            System.out.println(sb.reverse().toString());
            System.out.println(reverseNumber(str));
        }
        scanner.close();
    }
    private static String reverseNumber(String str){
        int num=Integer.parseInt(str);
        StringBuilder builder=new StringBuilder();
        while (num!=0){
            builder.append(num%10);
            num/=10;
        }
        return builder.toString();
    }
}